﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using MySql.Data.MySqlClient;

namespace SaleWebsite.library
{
    public class Params
    {
        public static IEnumerable<MySqlParameter> GetAllParams(object s)
        {

            Type type = s.GetType();
            foreach (var item in type.GetProperties())
            {
                var name = string.Format("{0}", item.Name);
                var value = item.GetValue(s, null);
                yield return new MySqlParameter(name, value);
            }
        }
    }
}